﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;

namespace la.P2KServer
{
    /// <summary>
    /// Базовый элемент для всего проекта
    /// </summary>
    public class P2KServerBase : UserControl
    {
        /// <summary>
        /// Событие получение данных из кэша
        /// </summary>
        public static readonly RoutedEvent ResiveDataEvent;
        /// <summary>
        /// 
        /// </summary>
        public static readonly RoutedEvent ResiveCompliteEvent;

        public event RoutedEventHandler ResiveComplite
        {
            add
            {

                base.AddHandler(P2KServerBase.ResiveCompliteEvent, value);
            }
            remove
            {
                base.RemoveHandler(P2KServerBase.ResiveCompliteEvent, value);
            }
        }
        public event RoutedEventHandler ResiveData
        {
            add
            {

                base.AddHandler(P2KServerBase.ResiveDataEvent, value);
            }
            remove
            {
                base.RemoveHandler(P2KServerBase.ResiveDataEvent, value);
            }
        }

        static P2KServerBase()
        {
            P2KServerBase.ResiveDataEvent = EventManager.RegisterRoutedEvent("ResiveData", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(P2KServerBase));
            P2KServerBase.ResiveCompliteEvent = EventManager.RegisterRoutedEvent("ResiveComplite", RoutingStrategy.Direct, typeof(RoutedEventHandler), typeof(P2KServerBase));
        }
    }
}
